import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import jsx from '@vitejs/plugin-vue-jsx'

// https://vitejs.dev/config/
export default defineConfig({
  base: '',
  plugins: [vue(), jsx()],
  optimizeDeps: {
    include: ["echarts", "axios"]
  },
  server: {
    proxy: {
      '^/cloudportal/paasmonitor': {
        target: 'http://10.50.208.47:8011',
        changeOrigin: true,
      },
    }
  },
  build: {
    cleanCssOptions: {},
    rollupOptions: {
      output: {
        manualChunks(id) {
          if (id.includes('/node_modules/vue')) {
            return 'vue.runtime';
          }
          if (id.includes('/node_modules/axios')) {
            return 'axios';
          }
          if (id.includes('/node_modules/echarts')) {
            return 'echarts';
          }
        }
      }
    }
  }
})
